<template>
  <p>
    首页
    <!-- 使用子组件 -->
    <Homechild tit="basketball" :fn="Fn" @myevent="getdataFn"></Homechild>
  </p>
</template>

<script setup lang="ts">
// 引入子组件 Homechild.vue
import Homechild from '@/components/Homechild.vue'
const Fn = (m: string): void => {
  console.log(m);

}

// 监听子组件传递的自定义事件
interface dataType {
  name: string,
  age: number
}
const getdataFn = (data: dataType) => {
  console.log(data);

}

</script>